/*

AJAX Content Load

*/

function load_content(name,target2) {
   
    if (target2===undefined) {
    switch(name)
    {
        case 'home': target='#page_HOME';  break;
        case 'slider1': target='#page_SLIDER'; break;
        case 'slider2': target='#page_SLIDER2';  break;
        case 'slider3': target='#page_SLIDER3';  break;
        case 'slider4': target='#page_SLIDER4';  break;
        case 'video_slider': target='#page_VIDEO_SLIDER';  break;
        
        case 'bio': target='#page_BIO';  break;
        case 'news': target='#page_NEWS';  break;
        case 'tour': target='#page_TOUR';  break;
        case 'twitter': target='#page_MY_TWEETS';  break;
        
        case 'music': target='#page_MUSIC';  break;
        case 'discography': target='#page_DISCOGRAPHY';  break;
        case 'blog': target='#page_BLOG';  break;
        
        case 'gallery1': target='#page_GALLERY1';  break;
        case 'gallery2': target='#page_GALLERY2';  break;
        case 'gallery3': target='#page_GALLERY3';  break;
        case 'gallery4': target='#page_GALLERY4';  break;
        
        case 'contacts': target='#page_CONTACTS';  break;
        
        case 'single_blog' :target='#page_SINGLE_BLOG'; break;
        case 'read_more' :target='#page_READ_MORE'; break;
      
    } } else { 
        
        target=target2;
    
    switch(target)
    {
        case '#page_HOME': name='home';  break;
        case '#page_SLIDER': name='slider1'; break;
        case '#page_SLIDER2': name='slider2';  break;
         case '#page_SLIDER3': name='slider3';  break;
          case '#page_SLIDER4': name='slider4';  break;
        
        case '#page_VIDEO_SLIDER': name='video_slider';  break;
        
        case '#page_BIO': name='bio';  break;
        case '#page_NEWS': name='news';  break;
        case '#page_TOUR': name='tour';  break;
        case '#page_MY_TWEETS': name='twitter';  break;
        
        case '#page_MUSIC': name='music';  break;
        case '#page_DISCOGRAPHY': name='discography';  break;
        case '#page_BLOG': name='blog';  break;
        
        case '#page_GALLERY1': name='gallery1';  break;
        case '#page_GALLERY2': name='gallery2';  break;
        case '#page_GALLERY3': name='gallery3';  break;
        case '#page_GALLERY4': name='gallery4';  break;
        
        case '#page_CONTACTS': name='contacts';  break;
       case '#page_SINGLE_BLOG' :name='single_blog'; break;
       case '#page_READ_MORE' :name='read_more'; break;
    }
    
    }
    
  // alert(target+"-"+name);
    randomnumber=Math.floor(Math.random()*10001);
    
    $(target).load('modules/'+name+'.html?a='+randomnumber,function() {
          
                setTimeout(function() {
                
               switch(name)
    {
        
        case 'slider1': init_slides(); break;
        case 'slider2': init_slides();  break;
        case 'slider3': init_slides();  break;
        case 'slider4':init_slides();  break;
        case 'video_slider': init_video(); break;
        
        case 'bio':  init_video();  break;
        case 'news': init_news();  break;
        case 'tour': init_tour();  break;
        case 'twitter': init_twitter(); break;
        
        case 'music': init_player();  break;
        case 'discography': init_discography();  break;
        case 'blog': init_blog();  break;
        
        case 'gallery1': init_gallery();  break;
        case 'gallery2': init_gallery();  break;
        case 'gallery3': init_gallery();  break;
        case 'gallery4': init_gallery();  break;
        
        case 'contacts': target='#page_CONTACTS'; init_map(); init_contact(); break;
      
    }
                init_gallery();
              init_scroll();  
                cufon_init();
                init_arrows();
                
                },1000);
    });
          
      /*
        
        $.ajax({        
            url:'modules/'+name+'.html',
            beforeSend: function() {
                
            },
            success: function(data) {
                $(target).html(data);
                
                
                setTimeout(function() {
                
               switch(name)
    {
        
        case 'slider1': init_slides(); break;
        case 'slider2': init_slides();  break;
        case 'slider3': init_slides();  break;
        case 'slider4':init_slides();  break;
        case 'video_slider': target='#page_VIDEO_SLIDER';  break;
        
        case 'bio': target='#page_BIO';  break;
        case 'news': target='#page_NEWS';  break;
        case 'tour': target='#page_TOUR';  break;
        case 'twitter': target='#page_MY_TWEETS';  break;
        
        case 'music': target='#page_MUSIC';  break;
        case 'discography': target='#page_DISCOGRAPHY';  break;
        case 'blog': target='#page_BLOG';  break;
        
        case 'gallery1': target='#page_GALLERY1';  break;
        case 'contacts': target='#page_CONTACTS';  break;
      
    }
                
                
                cufon_init();
                },1000);
            }
            
        });
        */
    
}